<?php 
include "koneksi.php"; 
$result = mysql_query("select * from parkir"); 
$jsArray = "var nama = new Array();\n"; 
echo '<select name="kode" onchange="document.getElementById(\'nama\').value = nama[this.value]">'; 
echo '<option>-------</option>'; 
while ($row = mysql_fetch_array($result)) { 
    echo '<option value="' . $row['kode'] . '">' . $row['kode'] . '</option>'; 
    $jsArray .= "nama['" . $row['kode'] . "'] = '" . addslashes($row['nama']) . "';\n"; 
} 
echo '</select>'; 
?>
